import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeColumn, JVxeTypes} from "@/components/jeecg/JVxeTable/src/types";






export const jvcolumns: JVxeColumn[] = [
  // {
  //   title: '客户名',
  //   key: 'name',
  //   width: 180,
  //   type: JVxeTypes.input,
  //   defaultValue: '',
  //   placeholder: '请输入${title}',
  //   validateRules: [{ required: true, message: '${title}不能为空' }],
  // },
  {
    title: '产品',
    key: 'productNo',
    width: 180,
    type: JVxeTypes.select,
    options: [
    ],
    optionUrl: '/biz/bizBasicInfo/alllist' , // 下拉选项数据请求的URL
    placeholder: '请选择${title}',
  },
  {
    title: '数量',
    key: 'qty',
    type: JVxeTypes.inputNumber,
    defaultValue: '',
    placeholder: '请输入${title}',
  },
  {
    title: '金额',
    key: 'amount',
    type: JVxeTypes.inputNumber,
    defaultValue: '',
    placeholder: '请输入${title}',
  },
  {
    title: '备注',
    key: 'notes',
    width: 180,
    type: JVxeTypes.input,
    defaultValue: '',
    placeholder: '请输入${title}',
  }
]


export const columns: BasicColumn[] = [
    {
    title: '出库表',
    dataIndex: 'outboundId'
   },
   {
    title: '产品编号',
    dataIndex: 'productNo'
   },
   {
    title: '产品名称',
    dataIndex: 'productName'
   },
   {
    title: '数量',
    dataIndex: 'qty'
   },
   {
    title: '金额',
    dataIndex: 'amount'
   },
   {
    title: '备注',
    dataIndex: 'desc'
   },
];

export const searchFormSchema: FormSchema[] = [
 {
    label: '出库表',
    field: 'outboundId',
    component: 'Input'
  },
 {
    label: '产品编号',
    field: 'productNo',
    component: 'Input'
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  {label: '', field: 'id', component: 'Input', show: false},
  {
    label: '出库表',
    field: 'outboundId',
    component: 'Input',
  },
  {
    label: '产品编号',
    field: 'productNo',
    component: 'Input',
  },
  {
    label: '产品名称',
    field: 'productName',
    component: 'Input',
  },
  {
    label: '数量',
    field: 'qty',
    component: 'InputNumber',
  },
  {
    label: '金额',
    field: 'amount',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'notes',
    component: 'Input',
  },
];
